﻿/* Muaz Khan – http://dashingquill.web.officelive.com */
using System.Web.Mvc;

namespace DTweet.Helpers
{
    public class ValidateRequestAttribute : ActionFilterAttribute
    {
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            if(!Static.IsValidRequest)
            {
                var result = new RedirectToRouteResult("login", null);
                result.ExecuteResult(filterContext.Controller.ControllerContext);
            }
            base.OnActionExecuting(filterContext);
        }
    }
}